-- poisoning_to_status
-- create by zhuangsl
-- 附加属性：中毒获得状态

return {
    apply = function(prop, baseValue)
        -- 数量
        return prop[3];
    end,

    -- 中毒触发
    trigger = function(who, prop, arg)
        local status = prop[2];
        local value = prop[3];

        local endRound = prop[4];
        if prop[4] > 0 then
            endRound = CombatM.getRound() + prop[4] + 1;

            if type(arg) == "table" and arg["no_cost"] == true then
                endRound = endRound - 1;
            end
        end

        local condition = {
            ["value"] = prop[3],
            ["end_round"] = endRound,
        };

        -- 附加状态
        CombatStatusM.applyStatus(who, status, condition);
    end,

    record = function(target, prop, path)
        return false;
    end
};
